package cloud.maque.admin.service;

import cloud.maque.admin.domain.entity.MqPrivilege;
import cloud.maque.framework.common.request.PaginateDataResquest;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @author 4color
 * @description mq_privilege服务层
 * @date 2023-03-17
 */

public interface MqPrivilegeService extends IService<MqPrivilege> {


    /**
     * 插入一条记录
     *
     * @param privilege 记录对象
     * @return 是否成功
     */
    MqPrivilege savePrivilege(MqPrivilege privilege);

    Boolean delete(String privilegeId,String tenantId);


    Boolean deleteByMenuId(String menuId);


    Integer countByGroupId(String groupId);

    /**
     * 分页查询
     *
     * @param pageReq
     * @return
     */
    PageInfo<MqPrivilege> page(PaginateDataResquest<MqPrivilege> pageReq);

    List<MqPrivilege> allList(MqPrivilege pageReq);

    MqPrivilege CreateMenuPrivileleg(String menuId, String tenantId);

}
